package com.taiyuan.ty.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.taiyuan.ty.entity.Comment;
import com.taiyuan.ty.mapper.CommentMapper;
import com.taiyuan.ty.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
 * @author : 周桓宇
 * @description :
 * @createDate : 2025/3/26 下午4:43
 */
@Service
public class CommentServiceImpl extends ServiceImpl<CommentMapper, Comment> implements CommentService {
    @Autowired
    private CommentMapper commentMapper;

    public List<Comment> getCommentsByPlaceId(Long placeId) {
        QueryWrapper<Comment> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("place_id", placeId);
        return commentMapper.selectList(queryWrapper);
    }
}

